<?php
  include("include/conn.php");
  
  if(isset($_REQUEST['partyId']))
    $totalId = $_REQUEST['partyId'];
  else
	  $totalId = $_REQUEST['total_ids'];
	  
	$totalId=split(",",$totalId);
	$deleteId="";
	for($i=0;$i < count($totalId);$i++) //to skip extra "0" that we have taken when passing form argument
	{

    if(isset($_REQUEST['partyId']))
 		  @$checkboxvalue = $_REQUEST['partyId'][$i];
    else
		  @$checkboxvalue = $_REQUEST['C1_'.$totalId[$i]];

		if(isset($checkboxvalue))
		{
			$deleteId.=",".$totalId[$i];
		}
	}
	if($deleteId!="")
	{
		$deleteId=substr($deleteId,1);
	  $query1 = "DELETE FROM party 
	              WHERE partyId IN (".$deleteId.")";
	  $result1=mysql_query($query1);
	}
	
	mysql_close($con) or die("error closing connection");
  header("Location:partyList.php");
	exit();
 ?>